﻿using System;

namespace ComToolkit.IO
{
    public class DirectoryInfo : IDisposable
    {
        private dynamic folder;

        internal DirectoryInfo(dynamic folder)
        {
            this.folder = folder;
        }

        public bool IsRootFolder
        {
            get { return (bool)folder.IsRootFolder; }
        }

        public string Name
        {
            get { return (string)folder.Name; }
        }

        public DirectoryInfo ParentFolder
        {
            get { return new DirectoryInfo(folder.ParentFolder); }
        }

        public string Path
        {
            get { return folder.Path; }
        }

        public string ShortName
        {
            get { return (string)folder.ShortName; }
        }

        public string ShortPath
        {
            get { return (string)folder.ShortPath; }
        }

        public long Size
        {
            get { return (long)folder.Size; }
        }

        public string Type
        {
            get { return (string)folder.Type; }
        }

        //public string Drive { get { return (string)folder.Drive; } }
        public DateTime DateCreated
        {
            get { return (DateTime)folder.DateCreated; }
        }

        public DateTime DateLastAccessed
        {
            get { return (DateTime)folder.DateLastAccessed; }
        }

        public DateTime DateLastModified
        {
            get { return (DateTime)folder.DateLastModified; }
        }

        //Files
        //SubFolders
        //http://www.w3schools.com/asp/asp_ref_folder.asp

        #region IDisposable Members

        public void Dispose()
        {
            folder = null;
        }

        #endregion
    }
}